package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface SetmealDishMapper {
    /**
     *根据菜品id查询到对应的套餐id
     * @param dishIds
     * @return java.util.List<java.lang.Long>
     */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    /**
     *批量保存套餐和菜品的关联关系
     * @param setmealDishes
     * @return void
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     *根据套餐id删除套餐和菜品的关联关系
     * @param setmealIds
     * @return void
     */
    void deleteBySetmealIds(List<Long> setmealIds);

    /**
     *根据套餐id查询套餐和菜品的关联关系
     * @param setmealId
     * @return java.util.List<com.sky.entity.SetmealDish>
     */
    @Select("select * from sky_take_out.setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);
}
